//
//  UIGraphicsImageRenderer.swift
//  Documentation
//
//  Created by Toj on 3/8/24.
//

import Foundation

@available(iOS 10.0, *)
open class UIGraphicsImageRenderer : UIGraphicsRenderer {

    /// 初始化
    public convenience init(size: CGSize)

    /// 初始化
    public init(size: CGSize, format: UIGraphicsImageRendererFormat)

    /// 初始化
    public init(bounds: CGRect, format: UIGraphicsImageRendererFormat)

    
    /// 从上下文中渲染一个UIimage
    open func image(actions: (UIGraphicsImageRendererContext) -> Void) -> UIImage

    
    /// 将上下文内容压缩成png图像数据返回
    open func pngData(actions: (UIGraphicsImageRendererContext) -> Void) -> Data
    
    /// 将上下文内容压缩成jpeg图像数据返回
    open func jpegData(withCompressionQuality compressionQuality: CGFloat, actions: (UIGraphicsImageRendererContext) -> Void) -> Data
}

@available(*, unavailable)
extension UIGraphicsImageRenderer : @unchecked Sendable {
}
